# coding:utf-8
"""
Author: r.xw
Date: 2023/12/9
File: app.py
"""
import logging
import os

from flask import Flask


def create_app():
    app = Flask(__name__, template_folder='../template', static_url_path='/', static_folder='../resource')
    init_blueprint(app)
    app.config['SECRET_KEY'] = os.urandom(24)

    return app


def init_blueprint(app):
    from controller.user import user
    app.register_blueprint(user)
    from controller.index import index
    app.register_blueprint(index)
    from controller.article import article
    app.register_blueprint(article)
